package com.lianjinsu.shop.service.impl;

import com.lianjinsu.shop.entity.Type;
import com.lianjinsu.shop.repository.dao.TypeDao;
import com.lianjinsu.shop.service.TypeService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class TypeServiceImpl implements TypeService {

    private final TypeDao typeDao;

    @Override
    public boolean insertOrUpdate(Type type) {
        return type.insertOrUpdate();
    }

    @Override
    public boolean deleteById(int id) {
        return typeDao.removeById(id);
    }

    @Override
    public List<Type> typeList() {
        return typeDao.list();
    }
}
